package serveur;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.io.*;
import java.net.*;

public class Accepter_connexion implements Runnable{

	private ServerSocket socketserver = null;
	public static Socket socket = null;
	
	public Thread t1;
	
	public Accepter_connexion(ServerSocket ss){
		 socketserver = ss;
	}
	
	@Override
	public void run() {
		try {
			while(true){
				
			socket = socketserver.accept();
			System.out.println("Un client veut se connecter  ");
			
			t1 = new Thread(new Reception(socket));
			t1.start();
			
			}
		} catch (IOException e) {
			
			System.err.println("Erreur serveur");
		}
	}

	public static Socket getSocket() {
		return socket;
	}

	public void setSocket(Socket socket) {
		this.socket = socket;
	}
}
